home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2004 April
/
Gamestar_61_2004-04_dvdb.iso
/
DVDStar
/
Editace
/
hltp.exe
/
{app}
/
Source Code
/
CZBindMaker
/
PrivateSettings
/
Setting.cs
next >
Wrap
Text File
|
2003-10-10
|
4KB
|
128 lines
/*****************************************************************************
Copyright ⌐ 2003 by Martin Cook. All rights are reserved. If you like this
code then feel free to go ahead and use it. The only thing I ask is that
you don't remove or alter my copyright notice. Your use of this software
is entirely at your own risk. I make no claims or warrantees about the
reliability or fitness of this code for any particular purpose. If you
make changes or additions to this code please mark your code as being
yours. If you have questions or comments then please contact me at:
martinc@outdrs.net
Have Fun! :o)
*****************************************************************************/
using System;
using System.ComponentModel;
using System.Collections;
using System.Diagnostics;
namespace PrivateSettings
{
/// <summary>
/// Represents a runtime application setting.
/// </summary>
[DesignTimeVisible(false), ToolboxItem(false)]
public class Setting : System.ComponentModel.Component
{
// *************************************************************************
// Attributes.
// *************************************************************************
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
/// <summary>
/// The storage key for this setting.
/// </summary>
private string m_storageKey = "";
/// <summary>
/// The default value for this setting.
/// </summary>
private string m_defaultValue = "";
/// <summary>
/// The current value of this setting.
/// </summary>
private string m_currentValue = "";
// *************************************************************************
// Properties.
// *************************************************************************
[Category("Misc")]
public string StorageKey
{
get {return m_storageKey;}
set {m_storageKey = value;}
} // End StorageKey
// *************************************************************************
[Category("Misc")]
public string DefaultValue
{
get {return m_defaultValue;}
set
{
m_defaultValue = value;
// Should we use the default value?
if (m_currentValue.Length == 0)
m_currentValue = m_defaultValue;
} // End set
} // End DefaultValue
// *************************************************************************
[Browsable(false)]
public string CurrentValue
{
get {return m_currentValue;}
set {m_currentValue = value;}
} // End CurrentValue
// *************************************************************************
// Constructors.
// *************************************************************************
public Setting(System.ComponentModel.IContainer container)
{
container.Add(this);
InitializeComponent();
} // End Setting()
// *************************************************************************
public Setting()
{
InitializeComponent();
} // End Setting()
// *************************************************************************
// Component Designer generated code.
// *************************************************************************
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
} // End class Setting
} // End namespace PrivateSettings